BlitzPrinter Userlib 3.0

 

 

This latest incarnation of the BlitzPrinter Userlib has undergone an entire rewrite.  The new library uses visual basic.  For me, the programming became extremely simple.  For you, the end-user and your end-users, it introduces some differences.  For one, the dll is no longer stand-alone.  It requires the visual basic runtimes.  Specifically SP6 of the visual basic runtime.  The install for this dll includes this runtime and you will need to include it in your installs you create as well. 

 

Distribution requirements are listed at the end of this documentation.

 

This dll is designed to add easy-to-use printer access to Blitz+ and Blitz3D programs.  It does NOT, due to the way it accesses DLL calls, work with the older BlitzBasic (2D) version.  Version 1.81 of Blitz3D is required as well to use this library.

 

Features:

  • Easy access to the printer common dialog box
  • Easy output of text, and text files to any installed local or network printer
  • Graphics primitive including circle, ellipse, box, line, point, etc
  • Output of bitmaps file in the BMP, JPG and GIF formats
  • Precise placement of text and graphics up to 1/1440th of an inch.
  • Rescaling of bitmaps on paper to any size regardless of aspect.
  • Changing of nearly all printer settings available in the common dialog via code only
  • Text rotation to any angle
  • Text on an arc (text oriented one way in relation to the arc)

 

Function List

 

BP_Arc(x%,y%,r%,s%,e%)

BP_AspectRatio#()

BP_Box(x1%,y1%,x2%,y2%,f%)

BP_Circle(x%,y%,r%)

BP_ColorMode%()

BP_CopyCount%()

BP_DrawImage(f$,x%,y%,w%,h%)

BP_DrawMode%()

BP_DrawStyle%()

BP_Duplex%()

BP_EndPrinting()

BP_FillColor%()

BP_FillStyle%()

BP_FontBold%()

BP_FontItalic%()

BP_FontName$()

BP_FontSize%()

BP_FontStrike%()

BP_FontTransparent%()

BP_FontUnderline%()

BP_ForeColor%()

BP_GetPrinterNames$()

BP_KillJob()

BP_Line(x1%,y1%,x2%,y2%)

BP_NewPage()

BP_Orientation%()

BP_Page%()

BP_PageHeight%()

BP_PageWidth%()

BP_PaperSize%()

BP_PaperSource%()

BP_PenWidth%()

BP_Plot(x%,y%)

BP_PrintDialog()

BP_PrinterName$()

BP_PrinterPort$()

BP_Quality%()

BP_ScaleHeight%()

BP_ScaleMode%()

BP_ScaleWidth%()

BP_SetAspectRatio(c#)

BP_SetColorMode(c%)

BP_SetCoordSystem(x1%,y1%,x2%,y2%)

BP_SetCopies(c%)

BP_SetDrawMode(c%)

BP_SetDrawStyle(c%)

BP_SetDuplex(c%)

BP_SetFillColor(r%,g%,b%)

BP_SetFillStyle(c%)

BP_SetFontBold(c%)

BP_SetFontItalic(c%)

BP_SetFontName(txt$)

BP_SetFontSize(c%)

BP_SetFontStrike(c%)

BP_SetFontTransparent(c%)

BP_SetFontUnderline(c%)

BP_SetForeColor(r%,g%,b%)

BP_SetOrientation(c%)

BP_SetPageDimensions(x%,y%)

BP_SetPaperSize(c%)

BP_SetPaperSource(c%)

BP_SetPenPos(x%,y%)

BP_SetPenWidth(c%)

BP_SetPrinter%(txt$)

BP_SetQuality(c%)

BP_SetScaleHeight(c%)

BP_SetScaleMode(c%)

BP_SetScaleWidth(c%)

BP_SetZoom(c%)

BP_StringHeight%(txt$)

BP_StringWidth%(txt$)

BP_Text(x%,y%,txt$)

BP_TextCenter(y%,r%,txt$)

BP_TextCircle(x%,y%,r%,sa%,da%,txt$)

BP_TextFilePrint(f$,h$,b$)

BP_TextLeft(y%,txt$)

BP_TextPrint(f$,h$,b$)

BP_TextRight(y%,r%,txt$)

BP_TextRotate(x%,y%,txt$,a%)

BP_TwipsPerPixelX%()

BP_TwipsPerPixelY%()

BP_XPos%()

BP_YPos%()

BP_Zoom%()

 

 

Function Details:

 

BP_Arc(x%,y%,r%,s%,e%)

 

Draws an arc on the paper using the current foreground color defined by BP_SetForeColor

 

X          x position

Y          y position

R          radius of arc

S          start angle

E          end angle

 

 

BP_ AspectRatio#()

 

Defaults to 1.0.  Returns the aspect ratio of arcs and circles.  Setting it to less than 1 or greater than one will skew the circle left-right or up-down.

 

 

BP_Box(x1%,y1%,x2%,y2%,f%)

 

Draws a box on the paper using the current foreground color, and is also optionally filled using the current fill color and fill style.

 

X1         Top left x position of box

Y1        Top left y position of box

X2         Bottom right x position of box

Y2        Bottom right y position of box

F          Filled or not (1 = yes, 0 = no)

 

 

BP_Circle(x%,y%,r%)

 

Draws a circle or ellipse on the paper using the current foreground color.  Setting the fillcolor and fill style results in a filled circle or ellipse.

 

X          X position of the center of the circle

Y          Y position of the center of the circle

R          Radius of the circle

 

 

BP_ColorMode%()

 

Returns the current color mode.

 

BP_CMMonochrome      1          Black and white

BP_CMColor                 2          Color

 

 

BP_CopyCount%()

 

Returns the number of copies set to print when the BP_EndPrinting() function is called.

 

 

BP_DrawImage(f$,x%,y%,w%,h%)

 

This command sends a bitmap file to the current page being drawn.  Note that like all draw commands, it prints over anything that has already been printed, so if you want a background image, draw it first.  Then draw anything over the top of it you want.

 

F$        Filename of image to send to the printer

X          X position on the paper to print

Y          Y position on the paper to print

W         Width of the picture (pass 0 if you want original size)

H          Height of the picture (pass 0 if you want original size)

 

Using the Width and Height parameters you can cause the image to be any size you want.  You may use BP_PageWidth and BP_PageHeight to set a picture to print full page, or modify the return from those functions to print to a fractional amount of the page size, etc.  It will use the current scale mode (twips, inches, etc).

 

 

BP_DrawMode%()

 

Returns the current draw mode for graphics methods.

 

BP_Black          1      All drawing commands will be in “black”

BP_NotMerge    2      Inverse setting of 15

BP_MaskNot     3      Combination of background and inverse of forecolor

BP_NotCopy     4      Inverse setting of 13

BP_MaskPen    5      Combination of colors common to forecolor and inverse of fillcolor

BP_Invert          6      Inverse of the forecolor

BP_XOR           7      Exclusive or drawing

BP_NotMask     8      Inverse of 9

BP_Mask          9      Combination of common colors to forecolor and fillcolor

BP_NotXOR      10     Inverse of 7

BP_DoNothing   11     Draws nothing.  No operation is performed.

BP_MergeNot    12     Combination of fillcolor and inverse of forecolor

BP_Copy          13     Forecolor (default and most used)

BP_MergeNot    14     Combination of forecolor and inverse of fillcolor

BP_Merge         15     Combination of forecolor and fillcolor

BP_White                 16     Everything drawn in white.  Effectively the same as 11

 

 

BP_DrawStyle%()

 

Returns the current drawing style for graphics methods

 

BP_Solid                   0      Solid line / fill (Default)

BP_Dash                  1      Dash

BP_Dot                     2      Dot

BP_DashDot             3      Dash Dot

BP_DashDotDot        4      Dash Dot Dot

BP_Transparent         5      Transparent (Do nothing)

BP_InsideSolid          6      Inside Solid

 

 

BP_Duplex%()

 

Returns the currently set duplexing setting.

 

BP_Simplex                  1          Simplex printing (1 sided)

BP_HorizontalDuplex     2          Duplexing on the horizontal side

BP_VerticalDuplex         3          Duplexing on the vertical side

 

 

BP_EndPrinting()

 

Ends the current document and sends everything remaining to the printer.  Create a new document by simply starting to send printing commands again.  This does NOT do the same as BP_Cleanup().  It merely ends the current document.

 

 

BP_FillColor%()

 

Returns an integer that determines the current color used for filling boxes, circles, etc.  This integer can be broken up into it’s RGB values with BP_GetBlueValue(), BP_GetGreenValue(), and BP_GetRedValue().

 

 

BP_FillStyle%()

 

Sets the fill style for filled circles, boxes, etc.

 

BP_FSSolid              0      Solid fill using the fillcolor

BP_FSTransparent     1      Nothing.  No color.

BP_FSHorizLine        2      A set of horizontal lines the color of fillcolor

BP_FSVertLine          3      A set of vertical lines the color of fillcolor

BP_FSUpDiag           4      A set of diagonal lines

BP_FSDownDiag       5      A reversed set of diagonal lines

BP_FSCross             6      A grid of lines

BP_FSDiagCross       7      A diagonal grid of lines

 

 

BP_FontBold%()

 

Returns the currently set Bold status for text printing.

0                     False

1                     True

 

 

BP_FontItalic%()

 

Returns the currently set Italic status for text printing.

0                     False

1                     True

 

 

BP_FontName$()

 

Returns the name of the current printer font.

 

 

BP_FontSize%()

 

Returns the size in points of the currently selected font.

 

 

BP_FontStrike%()

 

Returns the currently set Strikethrough status for text printing.

0                     False

1                     True

 

 

BP_FontTransparent%()

 

Returns the currently set Transparent status for text printing.

0                     False

1                     True

 

 

BP_FontUnderline%()

 

Returns the currently set Underline status for text printing.

0                     False

1                     True

 

 

BP_ForeColor%()

 

Returns an integer value for the currently selected foreground color.  This integer can be broken up into it’s RGB values with BP_GetBlueValue(), BP_GetGreenValue(), and BP_GetRedValue().

 

 

BP_GetPrinterNames$()

 

Returns a single string containing the names of all printers separated by a tilde (~) character.  You can then break them apart using INSTR().  You can use this function along with BP_SetPrinter and the other BP_Set commands to print to different printers and use different settings without having to use the printer dialog box.  This would be useful for Blitz3D programs where the printer dialog would be intrusive, if visible at all.

 

 

BP_KillJob()

 

This routine cancels the current print job.  It’s effectively the same as BP_EndPrinting(), but instead of sending spooled print to the printer it cancels the job.

 

 

BP_Line(x1%,y1%,x2%,y2%)

 

Draws a line on the paper from point X1, Y1 to X2, Y2 using the current foreground color.

 

X1         Starting x position of line

Y1        Starting y position of line

X2         Ending x position of line

Y2        Ending y position of line

 

 

BP_NewPage()

 

Begins a new page.  All further printing commands will be sent to this new page.  There is no way to return to the previous page.  It is spooled and ready to print.

 

 

BP_Orientation%()

 

Returns the current paper orientation setting.

 

BP_Portrait                   1          Portrait

BP_Landscape              2          Landscape

 

 

BP_Page%()

 

Returns the current page number of a multi-page document.  If you use BP_NewPage() you will see this number change.  In this way you may print page numbers.

 

 

BP_PageHeight%()

 

Returns the page height in TWIPS.  This is irregardless if you have set the scale mode to something other that twips.  A twip is 1440 twips per inch.  Despite a printer possibly having a higher resolution, this is the highest resolution you can use for placement.

 

 

BP_PageWidth%()

 

Returns the page width in TWIPS.  This is irregardless if you have set the scale mode to something other that twips.  A twip is 1440 twips per inch.  Despite a printer possibly having a higher resolution, this is the highest resolution you can use for placement.

 

 

BP_PaperSize%()

 

Returns the size of the paper currently set to print to. 

 

BP_SZLetter                      1      Letter, 8.5 x 11

BP_SZSmallLetter             2      Letter Small, 8.5 x 11

BP_SZTabloid                    3      Tabloid,  11 x 17

BP_SZLedger                    4      Ledger, 17 x 11

BP_SZLegal                      5      Legal, 8.5 x 14

BP_SZStatement               6      Statement,  5.5 x 8.5

BP_SZExecutive                7      Executive,   7.5 x 10.5

BP_SZA3                          8      A3,  297 x 420 mm

BP_SZA4                          9      A4,  210 x 297 mm

BP_SZA4Small                  10     A4 Small,  210 x 297 mm

BP_SZA5                          11     A5,  148 x 210 mm

BP_SZB4                          12     B4,  250 x 354 mm

BP_SZB5                          13     B5,  182 x 257 mm

BP_SZFolio                       14     Folio,  8.5 x 13

BP_SZQuarto                    15     Quarto,  215 x 275 mm

BP_SZ10x14                     16     10 x 14

BP_SZ11x17                     17     11 x 17

BP_SZNote                       18     Note,  8.5 x 11

BP_SZEnv9                       19     Envelope #9, 3 7/8 x 8 7/8

BP_SZEnv10                     20     Envelope #10,  4 1/8 x 9 1/2

BP_SZEnv11                     21     Envelope #11,  4.5 x 10 3/8

BP_SZEnv12                     22     Envelope #12,  4.5 x 11

BP_SZEnv14                     23     Envelope #14,  5 x 11.5

BP_SZCSheet                   24     C Size Sheet

BP_SZDSheet                   25     D Size Sheet

BP_SZESheet                   26     E Size Sheet

BP_SZEnvDL                     27     Envelope DL,  110 x 220 mm

BP_SZEnvC3                     28     Envelope C3,  324 x 458 mm

BP_SZEnvC4                     29     Envelope C4,  229 x 324 mm

BP_SZEnvC5                     30     Envelope C5,  162 x 229 mm

BP_SZEnvC6                     31     Envelope C6,  114 x 162 mm

BP_SZEnvC65                   32     Envelope C65,  114 x 229 mm

BP_SZEnvB4                     33     Envelope B4,  250 x 353 mm

BP_SZEnvB5                     34     Envelope B5,  176 x 250 mm

BP_SZEnvB6                     35     Envelope B6,  176 x 125 mm

BP_SZEnvItaly                   36     Envelope, 110 x 230 mm

BP_SZEnvMonarch            37     Envelope Monarch,  3 7/8 x 7.5

BP_SZEnvPersonal            38     Envelope, 3 5/8 x 6.5

BP_SZFanfoldUS               39     US Standard Fanfold,  14 7/8 x 11

BP_SZFanGermanStd        40     German Standard Fanfold, 8.5 x 12

BP_SZFanGermanLgl         41     German Legal Fanfold,  8.5 x 13 

BP_SZUserDefined            256   User defined by setting BP_SetWidth and

                                                BP_SetHeight

 

 

BP_PaperSource%()

 

Returns the current paper source.

 

BP_PSUpper                     1      Upper Bin

BP_PSLower                     2      Lower Bin

BP_PSMiddle                    3      Middle Bin

BP_PSManual                   4      Manual Feed

BP_PSEnvelope                5      Envelope Tray

BP_PSEnvManual              6      Manual Feed Envelope

BP_PSAuto                       7      Let the printer decide

BP_PSTractor                   8      Tractor Feed

BP_PSSmallFormat           9      Small Format Bin

BP_PSLargeFormat           10     Large Format Bin

BP_PSLargeCapacity         11     Large Capacity Bin

BP_PSCartridge                12     Cartridge

 

 

BP_PenWidth%()

 

Returns the current pen width for graphics primitives like Circle, Box, Line, etc.  If drawstyle is also set, any width greater than 1 will produce a solid line.

 

 

BP_Plot(x%,y%)

 

Draws a dot on the paper at location X, Y

 

X          X position to draw dot

Y          Y position to draw dot

 

 

BP_PrintDialog()

 

Brings up the standard windows printer dialog.  Settings that the dialog can set, are set.

 

BETA:  Let me know if there are any settings that are NOT set with the standard dialog as I didn’t do a lot of testing beyond page orientation and number of copies.

 

 

BP_PrinterName$()

 

Returns the current printer name.  This should be the same name as is listed in the printer dialog and also returned from the list of names when calling BP_GetPrinterNames().

 

 

BP_PrinterPort$()

 

Returns a string describing the current printer’s connection port.  IE: USB, Parallel, etc.

 

 

 

BP_Quality%()

 

Returns the currently set printer quality.  There are a limited number of settings returned and none detail exactly what the resolution is.

 

BP_Draft                   -1

BP_Low                    -2

BP_Medium              -3

BP_High                   -4

 

 

BP_ScaleHeight%()

 

Returns the current height of the page using the scaling settings.  If scaling is set to pixels it will return the page height in pixels.  Inches returns inches.  Etc.

 

 

BP_ScaleMode%()

 

Returns the currently set ScaleMode

 

BP_SMUserDefined           0      User define scale mode using BP_SetScaleWidth() and

                                                BP_SetScaleHeight()

BP_SMTwips                     1      Set scalemode to Twips

BP_SMPoints                    2      Set scalemode to Points

BP_SMPixels                    3      Set scalemode to Pixels

BP_SMCharacters             4      Set scalemode to Characters

BP_SMInches                   5      Set scalemode to Inches

BP_SMMillimeters             6      Set scalemode to Millimeters

BP_SMCentimeters           7      Set scalemode to Centimeters

BP_SMHiMetric                 8      Set scalemode to Hi Metric

BP_SMContainerPos         9      Not useful for printing.

BP_SMContainerSize         10     Not useful for printing.

 

 

BP_ScaleWidth%()

 

Returns the current width of the page using the scaling settings.  If scaling is set to pixels it will return the page width in pixels.  Inches returns inches.  Etc.

 

 

BP_SetAspectRatio(c#)

 

Sets the current aspect ratio for circle and arc routines.

 

C          defaults to 1.0, but may be set to other numbers to skew the circle into an ellipse.

 

 

BP_SetColorMode(c%)

 

Sets the current color mode.

 

BP_CMMonochrome      1          Black and white

BP_CMColor                 2          Color

 

 

BP_SetCoordSystem(x1%,y1%,x2%,y2%)

 

Sets the current coordinate system.  This allows the user to set a custom coordinate system.  For instance, any page can then be 8500 x 11000. 

 

Example:  BP_SetCoordSystem(0,0,8500,11000) 

 

The above example sets the coordinates to 0 – 8500 X, and 0 – 11000 Y.

 

Example:  BP_SetCoordSystem(1000,2000,10000,20000)

 

The above example sets the coordinates to 1000 – 10000 X, and 2000 – 20000 Y.

 

X1         Top left X coordinate start

Y1        Top left Y coordinate start

X2         Bottom right X coordinate end

Y2        Bottom right Y coordinate end

 

 

BP_SetCopies(c%)

 

Sets the number of copies that you want of the current print job.

 

C          Number of copies to print

 

 

BP_SetDrawMode(c%)

 

Sets the current draw mode.

 

C          Draw mode as defined below

 

BP_Black          1      All drawing commands will be in “black”

BP_NotMerge    2      Inverse setting of 15

BP_MaskNot     3      Combination of background and inverse of forecolor

BP_NotCopy     4      Inverse setting of 13

BP_MaskPen    5      Combination of colors common to forecolor and inverse of fillcolor

BP_Invert          6      Inverse of the forecolor

BP_XOR           7      Exclusive or drawing

BP_NotMask     8      Inverse of 9

BP_Mask          9      Combination of common colors to forecolor and fillcolor

BP_NotXOR      10     Inverse of 7

BP_DoNothing   11     Draws nothing.  No operation is performed.

BP_MergeNot    12     Combination of fillcolor and inverse of forecolor

BP_Copy          13     Forecolor (default and most used)

BP_MergeNot    14     Combination of forecolor and inverse of fillcolor

BP_Merge         15     Combination of forecolor and fillcolor

BP_White                 16     Everything drawn in white.  Effectively the same as 11

 

 

BP_SetDrawStyle(c%)

 

Sets the current draw style.

 

C          Draw style as defined below

 

BP_Solid                   0      Solid line / fill (Default)

BP_Dash                  1      Dash

BP_Dot                     2      Dot

BP_DashDot             3      Dash Dot

BP_DashDotDot        4      Dash Dot Dot

BP_Transparent         5      Transparent (Do nothing)

BP_InsideSolid          6      Inside Solid

 

 

BP_SetDuplex(c%)

 

Sets the duplexing mode for the current print job.

 

C          Duplexing style as defined below

 

BP_Simplex                  1          Simplex printing (1 sided)

BP_HorizontalDuplex     2          Duplexing on the horizontal side

BP_VerticalDuplex         3          Duplexing on the vertical side

 

 

BP_SetFillColor(r%,g%,b%)

 

Sets the current fill color for graphics methods.

 

R          Red (0-255)

G          Green (0-255)

B          Blue (0-255)

 

 

BP_SetFillStyle(c%)

 

Sets the current fill style for graphics methods.

 

C          Fill style as defined below.

 

BP_FSSolid              0      Solid fill using the fillcolor

BP_FSTransparent     1      Nothing.  No color.

BP_FSHorizLine        2      A set of horizontal lines the color of fillcolor

BP_FSVertLine          3      A set of vertical lines the color of fillcolor

BP_FSUpDiag           4      A set of diagonal lines

BP_FSDownDiag       5      A reversed set of diagonal lines

BP_FSCross             6      A grid of lines

BP_FSDiagCross       7      A diagonal grid of lines

 

 

BP_SetFontBold(c%)

 

Sets the current setting for bold text.

 

C          0 – No Bold,  1 – Bold text

 

BP_SetFontItalic(c%)

 

Sets the current setting for italic text.

 

C          0 – No italics,  1 – Italic text

 

 

BP_SetFontName(txt$)

 

Sets the current font.  Any font that’s available to windows can be printed.  You merely need to set it via font name.  It is the same font name that is stated in the drop downs for most word processors.

 

Txt$      Font name to change to.

 

Example:  BP_SetFontName(“Courier New”)

Example:  BP_SetFontName(“Impact”)

 

 

BP_SetFontSize(c%)

 

Sets the current font size (in points)

 

C          Font size (1 – 255)

 

 

BP_SetFontStrike(c%)

 

Sets the current setting for font strikethrough.

 

C          0 – No strikethrough,  1 – Strikethrough text

 

 

BP_SetFontTransparent(c%)

 

Sets the current setting for font transparency.  Note that setting transparency to on causes no text to print.  It’s transparent…  DUH!

 

C          0 – No transparency,  1 – Transparent text

 

 

BP_SetFontUnderline(c%)

 

Sets the current setting for font underlining.

 

C          0 – No Underlining,  1 – Underlined text

 

 

BP_SetForeColor(r%,g%,b%)

 

Sets the current foreground color for all subsequent commands.

 

R          Red (0-255)

G          Green (0-255)

B          Blue (0-255)

 

 

BP_SetOrientation(c%)

 

Sets the current orientation of the printing.

 

C          Paper orientation as described below.

 

BP_Portrait                   1          Portrait

BP_Landscape              2          Landscape

 

 

BP_SetPageDimensions(x%,y%)

 

You may set the physical size of the paper.  It is preferable to set the paper using one of the preset sizes with BP_SetPaperSize(), but in this way you have precise control of the paper sizing.  If you set the paper to a size that the printer cannot handle, it will simply set it to a default, or the closest size that matches your dimensions.

 

X          Width of paper (using scale mode)

Y          Height of paper (using scale mode)

 

 

BP_SetPaperSize(c%)

 

Sets the paper size to a preset size as defined below.

 

C          paper size as defined below.

 

BP_SZLetter                      1      Letter, 8.5 x 11

BP_SZSmallLetter             2      Letter Small, 8.5 x 11

BP_SZTabloid                    3      Tabloid,  11 x 17

BP_SZLedger                    4      Ledger, 17 x 11

BP_SZLegal                      5      Legal, 8.5 x 14

BP_SZStatement               6      Statement,  5.5 x 8.5

BP_SZExecutive                7      Executive,   7.5 x 10.5

BP_SZA3                          8      A3,  297 x 420 mm

BP_SZA4                          9      A4,  210 x 297 mm

BP_SZA4Small                  10     A4 Small,  210 x 297 mm

BP_SZA5                          11     A5,  148 x 210 mm

BP_SZB4                          12     B4,  250 x 354 mm

BP_SZB5                          13     B5,  182 x 257 mm

BP_SZFolio                       14     Folio,  8.5 x 13

BP_SZQuarto                    15     Quarto,  215 x 275 mm

BP_SZ10x14                     16     10 x 14

BP_SZ11x17                     17     11 x 17

BP_SZNote                       18     Note,  8.5 x 11

BP_SZEnv9                       19     Envelope #9, 3 7/8 x 8 7/8

BP_SZEnv10                     20     Envelope #10,  4 1/8 x 9 1/2

BP_SZEnv11                     21     Envelope #11,  4.5 x 10 3/8

BP_SZEnv12                     22     Envelope #12,  4.5 x 11

BP_SZEnv14                     23     Envelope #14,  5 x 11.5

BP_SZCSheet                   24     C Size Sheet

BP_SZDSheet                   25     D Size Sheet

BP_SZESheet                   26     E Size Sheet

BP_SZEnvDL                     27     Envelope DL,  110 x 220 mm

BP_SZEnvC3                     28     Envelope C3,  324 x 458 mm

BP_SZEnvC4                     29     Envelope C4,  229 x 324 mm

BP_SZEnvC5                     30     Envelope C5,  162 x 229 mm

BP_SZEnvC6                     31     Envelope C6,  114 x 162 mm

BP_SZEnvC65                   32     Envelope C65,  114 x 229 mm

BP_SZEnvB4                     33     Envelope B4,  250 x 353 mm

BP_SZEnvB5                     34     Envelope B5,  176 x 250 mm

BP_SZEnvB6                     35     Envelope B6,  176 x 125 mm

BP_SZEnvItaly                   36     Envelope, 110 x 230 mm

BP_SZEnvMonarch            37     Envelope Monarch,  3 7/8 x 7.5

BP_SZEnvPersonal            38     Envelope, 3 5/8 x 6.5

BP_SZFanfoldUS               39     US Standard Fanfold,  14 7/8 x 11

BP_SZFanGermanStd        40     German Standard Fanfold, 8.5 x 12

BP_SZFanGermanLgl         41     German Legal Fanfold,  8.5 x 13 

BP_SZUserDefined            256   User defined by setting BP_SetWidth and

 

 

BP_SetPaperSource(c%)

 

Sets the current source of the paper.  This setting can cause issues if you try to set it to a paper bin which does not exist on the printer.  This is another one that should be set by using the printer dialog or just letting the printer decide where to get the paper.

 

C          Paper source as defined below.

 

BP_PSUpper                     1      Upper Bin

BP_PSLower                     2      Lower Bin

BP_PSMiddle                    3      Middle Bin

BP_PSManual                   4      Manual Feed

BP_PSEnvelope                5      Envelope Tray

BP_PSEnvManual              6      Manual Feed Envelope

BP_PSAuto                       7      Let the printer decide

BP_PSTractor                   8      Tractor Feed

BP_PSSmallFormat           9      Small Format Bin

BP_PSLargeFormat           10     Large Format Bin

BP_PSLargeCapacity         11     Large Capacity Bin

BP_PSCartridge                12     Cartridge

 

 

BP_SetPenPos(x%,y%)

 

Sets the current position of the pen.  Not very useful as most commands have the x,y coordinates defined with them.  It might come into some use later if I decide to add some “offset” commands for creating graphics based on current pen position.

 

X          x position to set the pen

Y          y position to set the pen

 

 

BP_SetPenWidth(c%)

 

Sets the current pen width for any further drawing commands (circle, box, line, etc).

 

C          Size of pen in current scale mode.

 

 

BP_SetPrinter%(txt$)

 

This allows you to set the current printer, bypassing the printer dialog box.  You will need to use this command in conjunction with BP_GetPrinterNames().  If you want to just start printing, you may ignore this and all printer commands will be sent to the current default printer.

 

Txt$      Name of the printer to set to.

 

 

BP_SetQuality(c%)

 

Sets the quality of printing to one of 4 presets.  Specific resolution setting is not supported.

 

C          Print quality as defined below.

 

BP_Draft                   -1

BP_Low                    -2

BP_Medium              -3

BP_High                   -4

 

 

BP_SetScaleHeight(c%)

 

Sets the current scale height of the page.   Same as BP_SetPageDimensions() but on an individual X, Y scale.

 

C          User defined units of height for the current page.

 

 

BP_SetScaleMode(c%)

 

Sets the current scale mode.

 

C          Scale mode as defined below.

 

BP_SMUserDefined           0      User define scale mode using BP_SetScaleWidth() and

                                                BP_SetScaleHeight()

BP_SMTwips                     1      Set scalemode to Twips

BP_SMPoints                    2      Set scalemode to Points

BP_SMPixels                    3      Set scalemode to Pixels

BP_SMCharacters             4      Set scalemode to Characters

BP_SMInches                   5      Set scalemode to Inches

BP_SMMillimeters             6      Set scalemode to Millimeters

BP_SMCentimeters           7      Set scalemode to Centimeters

BP_SMHiMetric                 8      Set scalemode to Hi Metric

BP_SMContainerPos         9      Not useful for printing.

BP_SMContainerSize         10     Not useful for printing.

 

 

BP_SetScaleWidth(c%)

 

Sets the current scale height of the page.   Same as BP_SetPageDimensions() but on an individual X, Y scale.

 

C          User defined units of width for the current page.

 

 

BP_SetZoom(c%)

 

Sets the amount of zoom for the currently drawn page.

 

C          Zoom amount in percentage.  (100 default)

 

 

BP_StringHeight%(txt$)

 

Returns the height of the passed string based on the current scale mode.

 

Txt$      String passed.

 

 

BP_StringWidth%(txt$)

 

Returns the Width of the passed string based on the current scale mode.

 

Txt$      String passed.

 

 

BP_Text(x%,y%,txt$)

 

Prints text on the page based on the current font and fontsize at the point specified.

 

X          x position of text to be printed

Y          y position of text to be printed

Txt$      text to be printed

 

 

BP_TextCenter(y%,r%,txt$)

 

As BP_Text, but centers text based on the rightmost setting specified.

 

Y          y position of text to be centered.

R          rightmost margin allowed.  For full page pass BP_PageWidth()

Txt$      text to be printed

 

 

BP_TextCircle(x%,y%,r%,sa%,da%,txt$)

 

Draws text on an arc or around a circle.

 

X          x position of center of the circle/arc

Y          y position of center of the circle/arc

R          radius of the circle/arc

Sa        starting angle to print text

Da        ending angle to print text

Txt$      text to print

 

 

BP_TextFilePrint(f$,h$,b$)

 

Prints a text file using page breaks and header/footer.  Very simple and easy text file printing.

 

F$        filename of text to print

H$        header text

B$        footer text

 

 

BP_TextLeft(y%,txt$)

 

Left justifies text at the y position specified. 

 

Y          y position to print text

Txt$      text to print

 

 

BP_TextPrint(f$,h$,b$)

 

Same as BP_TextFilePrint(), but prints a set string up to 65k in size to the printer.

 

F$        text to print

H$        header text

B$        footer text

 

 

BP_TextRight(y%,r%,txt$)

 

Right justifies text based on the rightmost margin specified.

 

Y          y position of text to print.

R          rightmost margin for text to print at.

Txt$      text to print

 

 

BP_TextRotate(x%,y%,txt$,a%)

 

Prints rotated text on an angle.

 

X          x position to print text at

Y          y position to print text at

Txt$      text to print

A          angle to print text at.  0 – right, 90 – 12 oclock, 180 – 9 oclock, 270 – 6 oclock

 

 

BP_TwipsPerPixelX%()

 

Returns the amount of twips it takes to make a single pixel on paper in the x direction.

 

 

BP_TwipsPerPixelY%()

 

Returns the amount of twips it takes to make a single pixel on paper in the y direction.

 

 

BP_XPos%()

 

Returns the current x position of the “pen”

 

 

BP_YPos%()

 

Returns the current y position of the “pen”

 

 

BP_Zoom%()

 

Returns the current amount of zoom for the document.

 

 

 

Distribution requirements:

 

            MSVBVM60.DLL           (this can go in the windows or system32 directory)

                        Must be with the runtime included with service pack 5)

            VBADVANCE.TLB         (this can go in the install directory of the program/game)

            BLITZPRINTER.DLL       (this can also go in the install directory of the program/game)

 

Developer:

 

            When installing this library, the BLITZPRINTER.DLL and BLITZPRINTER.DECLS file needs to go into the USERLIBS directory of Blitz+ or Blitz3D in order to use while developing programs.  Also, you will need to close and reopen Blitz if you copy the stated files to your userlibs directory while blitz is open before the commands will be recognized by the IDE.

 

Have fun, and look for another freebie coming soon…  BlitzData Userlib (ADO wrapper for Blitz)

 

 

 

DONATIONWARE

 

This library is free.  No restrictions and no little “gotchas”.  Use it however you like.  What I do ask, is that if you use it, please give me credit in your program for it’s printing routines.  And if you would like, any donations via paypal will be more than welcome to estout@ntslink.net.  Again, neither of the above requests are required and the userlib is entirely free.  My donation back to the blitz community.

 

 

 

LEGAL DISCLAIMER

 

Neither STONEhenge Software nor Eric Stout shall be held accountable for any loss of data, property, or mental function should the library not work as provided.  I make no claims of warranty.  The software is provided AS-IS and no legal claims may be made against myself or my company should it fail.  If you do not agree to these terms, then delete the userlib, forget where you got it, and pretend you don’t know me.  These are not the droids you are looking for……..